//Class: -----------
//EItemInPluginParent
//description=A parent class for reflection and plugin testing
//parent=EItem,
//Function: void EItemInPluginParent()ifPureVirtual=0 G:=
//
//Function: void ~EItemInPluginParent()ifPureVirtual=0 G:=
//
//int ui_testIntParent G:EItemInPluginParent
//double ui_testDoubleParent G:EItemInPluginParent
//bool ui_testBoolParent G:EItemInPluginParent
//EVec3 ui_testVec3Parent G:EItemInPluginParent
//EVec4 ui_testVec4Parent G:EItemInPluginParent
//EMatrix4x4 ui_testMatrixParent G:EItemInPluginParent
//EString ui_testStringParent G:EItemInPluginParent
//Function: void ui_testParent(double v1double v2)ifPureVirtual=0 G:=EItemInPluginParent
//
//Function: void OnSet_ui_testIntParent(int value)ifPureVirtual=0 G:=EItemInPluginParent
//
//Function: void OnGet_ui_testIntParent(int & value)ifPureVirtual=0 G:=EItemInPluginParent
//
//Function: void OnSet_ui_testDoubleParent(double value)ifPureVirtual=0 G:=EItemInPluginParent
//
//Function: void OnGet_ui_testDoubleParent(double & value)ifPureVirtual=0 G:=EItemInPluginParent
//
//Function: void OnSet_ui_testBoolParent(bool value)ifPureVirtual=0 G:=EItemInPluginParent
//
//Function: void OnGet_ui_testBoolParent(bool & value)ifPureVirtual=0 G:=EItemInPluginParent
//
//Function: void OnSet_ui_testVec3Parent(const EVec3 & value)ifPureVirtual=0 G:=EItemInPluginParent
//
//Function: void OnGet_ui_testVec3Parent(EVec3 & value)ifPureVirtual=0 G:=EItemInPluginParent
//
//Function: void OnSet_ui_testVec4Parent(const EVec4 & value)ifPureVirtual=0 G:=EItemInPluginParent
//
//Function: void OnGet_ui_testVec4Parent(EVec4 & value)ifPureVirtual=0 G:=EItemInPluginParent
//
//Function: void OnSet_ui_testMatrixParent(const EMatrix4x4 & value)ifPureVirtual=0 G:=EItemInPluginParent
//
//Function: void OnGet_ui_testMatrixParent(EMatrix4x4 & value)ifPureVirtual=0 G:=EItemInPluginParent
//
//Function: void OnSet_ui_testStringParent(const EString & value)ifPureVirtual=0 G:=EItemInPluginParent
//
//Function: void OnGet_ui_testStringParent(EString & value)ifPureVirtual=0 G:=EItemInPluginParent
//
//ifPureVirtual=false
//
#include <DefineCommon.h>
#include <EItem.h>
#include <EItemMeta.h>
#include <EItemInPluginParent.h>
#include <Autogen/EItemInPluginParent_autogen.h>
    
/**class member functions*/
class EItemInPluginParent_MemberFun_ui_testParent : public EItemMetaFunction
{
         virtual void callInternal(intptr_t itemPtr, ... )
         {
             va_list args;
             va_start(args, itemPtr);

             EVariant* valueReturn = va_arg(args, EVariant*);
                
            EVariant* value_v1 = va_arg(args, EVariant*);
                
            EVariant* value_v2 = va_arg(args, EVariant*);
            

             EItemInPluginParent* itemSubPtr = (EItemInPluginParent*)this->getOwner();
                 itemSubPtr->ui_testParent(
                                      
                        value_v1->to_double(),
                  
                        value_v2->to_double()

                      );

             va_end(args);
         }
};
    
/**class set property functions*/
void EItemInPluginParent_OnSet_ui_testIntParent(intptr_t owner, const EVariant& value)
{
    EItemInPluginParent* itemSubPtr = (EItemInPluginParent*)owner;
    itemSubPtr->ui_testIntParent = value.to_int();
    itemSubPtr->OnSet_ui_testIntParent(value.to_int());
}

/**class get property functions*/
void EItemInPluginParent_OnGet_ui_testIntParent(intptr_t owner, EVariant& value)
{
    EItemInPluginParent* itemSubPtr = (EItemInPluginParent*)owner;
    itemSubPtr->OnGet_ui_testIntParent(value.to_int());
}

/**class set property functions*/
void EItemInPluginParent_OnSet_ui_testDoubleParent(intptr_t owner, const EVariant& value)
{
    EItemInPluginParent* itemSubPtr = (EItemInPluginParent*)owner;
    itemSubPtr->ui_testDoubleParent = value.to_double();
    itemSubPtr->OnSet_ui_testDoubleParent(value.to_double());
}

/**class get property functions*/
void EItemInPluginParent_OnGet_ui_testDoubleParent(intptr_t owner, EVariant& value)
{
    EItemInPluginParent* itemSubPtr = (EItemInPluginParent*)owner;
    itemSubPtr->OnGet_ui_testDoubleParent(value.to_double());
}

/**class set property functions*/
void EItemInPluginParent_OnSet_ui_testBoolParent(intptr_t owner, const EVariant& value)
{
    EItemInPluginParent* itemSubPtr = (EItemInPluginParent*)owner;
    itemSubPtr->ui_testBoolParent = value.to_bool();
    itemSubPtr->OnSet_ui_testBoolParent(value.to_bool());
}

/**class get property functions*/
void EItemInPluginParent_OnGet_ui_testBoolParent(intptr_t owner, EVariant& value)
{
    EItemInPluginParent* itemSubPtr = (EItemInPluginParent*)owner;
    itemSubPtr->OnGet_ui_testBoolParent(value.to_bool());
}

/**class set property functions*/
void EItemInPluginParent_OnSet_ui_testVec3Parent(intptr_t owner, const EVariant& value)
{
    EItemInPluginParent* itemSubPtr = (EItemInPluginParent*)owner;
    itemSubPtr->ui_testVec3Parent = value.to_EVec3();
    itemSubPtr->OnSet_ui_testVec3Parent(value.to_EVec3());
}

/**class get property functions*/
void EItemInPluginParent_OnGet_ui_testVec3Parent(intptr_t owner, EVariant& value)
{
    EItemInPluginParent* itemSubPtr = (EItemInPluginParent*)owner;
    itemSubPtr->OnGet_ui_testVec3Parent(value.to_EVec3());
}

/**class set property functions*/
void EItemInPluginParent_OnSet_ui_testVec4Parent(intptr_t owner, const EVariant& value)
{
    EItemInPluginParent* itemSubPtr = (EItemInPluginParent*)owner;
    itemSubPtr->ui_testVec4Parent = value.to_EVec4();
    itemSubPtr->OnSet_ui_testVec4Parent(value.to_EVec4());
}

/**class get property functions*/
void EItemInPluginParent_OnGet_ui_testVec4Parent(intptr_t owner, EVariant& value)
{
    EItemInPluginParent* itemSubPtr = (EItemInPluginParent*)owner;
    itemSubPtr->OnGet_ui_testVec4Parent(value.to_EVec4());
}

/**class set property functions*/
void EItemInPluginParent_OnSet_ui_testMatrixParent(intptr_t owner, const EVariant& value)
{
    EItemInPluginParent* itemSubPtr = (EItemInPluginParent*)owner;
    itemSubPtr->ui_testMatrixParent = value.to_EMatrix4x4();
    itemSubPtr->OnSet_ui_testMatrixParent(value.to_EMatrix4x4());
}

/**class get property functions*/
void EItemInPluginParent_OnGet_ui_testMatrixParent(intptr_t owner, EVariant& value)
{
    EItemInPluginParent* itemSubPtr = (EItemInPluginParent*)owner;
    itemSubPtr->OnGet_ui_testMatrixParent(value.to_EMatrix4x4());
}

/**class set property functions*/
void EItemInPluginParent_OnSet_ui_testStringParent(intptr_t owner, const EVariant& value)
{
    EItemInPluginParent* itemSubPtr = (EItemInPluginParent*)owner;
    itemSubPtr->ui_testStringParent = value.to_EString();
    itemSubPtr->OnSet_ui_testStringParent(value.to_EString());
}

/**class get property functions*/
void EItemInPluginParent_OnGet_ui_testStringParent(intptr_t owner, EVariant& value)
{
    EItemInPluginParent* itemSubPtr = (EItemInPluginParent*)owner;
    itemSubPtr->OnGet_ui_testStringParent(value.to_EString());
}

/**Function that create EItemMetaPtr*/
EItemMetaPtr EItemInPluginParent_createMeta(EItem* itemPtr)
{
    //ELOG_DEBUG("----------");
    EItemInPluginParent* itemSubPtr = (EItemInPluginParent*)itemPtr;
    EItemMetaPtr metaPtr = NewSmartPtr(EItemMeta)();
    metaPtr->setClassName("EItemInPluginParent");
    metaPtr->setClassDescription("A parent class for reflection and plugin testing");

    
    /**add class member function to metaPtr: ui_testParent*/
    {
        EItemMetaFunctionPtr fun = NewSmartPtr(EItemInPluginParent_MemberFun_ui_testParent)();
        fun->setName("ui_testParent");
        fun->setFunType(EItemMetaFunction::FunType::CLASS_MEMBER);
        fun->setOwner((intptr_t)itemPtr);
        fun->setGroupName("EItemInPluginParent");

        {
            EItemMetaPropertyPtr prop = NewSmartPtr(EItemMetaProperty)();
            prop->name = "returnValue";
            prop->typeName = "void";
            fun->setReturnProperty(prop);
        }

        
        {
            EItemMetaPropertyPtr prop = NewSmartPtr(EItemMetaProperty)();
            prop->name = "v1";
            prop->typeName = "double";
            fun->addProperty(prop);
        }
        
        {
            EItemMetaPropertyPtr prop = NewSmartPtr(EItemMetaProperty)();
            prop->name = "v2";
            prop->typeName = "double";
            fun->addProperty(prop);
        }
        

        metaPtr->addFunction(fun);
    }
    

    /**add properties to metaPtr*/
    
    /**property ui_testIntParent*/
    {
        EItemMetaPropertyPtr prop = NewSmartPtr(EItemMetaProperty)();
        prop->name = "ui_testIntParent";
        prop->typeName = "int";
        prop->value = itemSubPtr->ui_testIntParent;
        prop->m_owner = (intptr_t)itemSubPtr;
        prop->m_funSetProperty = EItemInPluginParent_OnSet_ui_testIntParent;
        prop->m_funGetProperty = EItemInPluginParent_OnGet_ui_testIntParent;
        prop->groupName = "EItemInPluginParent";

        metaPtr->addProperty(prop);
    }
    
    /**property ui_testDoubleParent*/
    {
        EItemMetaPropertyPtr prop = NewSmartPtr(EItemMetaProperty)();
        prop->name = "ui_testDoubleParent";
        prop->typeName = "double";
        prop->value = itemSubPtr->ui_testDoubleParent;
        prop->m_owner = (intptr_t)itemSubPtr;
        prop->m_funSetProperty = EItemInPluginParent_OnSet_ui_testDoubleParent;
        prop->m_funGetProperty = EItemInPluginParent_OnGet_ui_testDoubleParent;
        prop->groupName = "EItemInPluginParent";

        metaPtr->addProperty(prop);
    }
    
    /**property ui_testBoolParent*/
    {
        EItemMetaPropertyPtr prop = NewSmartPtr(EItemMetaProperty)();
        prop->name = "ui_testBoolParent";
        prop->typeName = "bool";
        prop->value = itemSubPtr->ui_testBoolParent;
        prop->m_owner = (intptr_t)itemSubPtr;
        prop->m_funSetProperty = EItemInPluginParent_OnSet_ui_testBoolParent;
        prop->m_funGetProperty = EItemInPluginParent_OnGet_ui_testBoolParent;
        prop->groupName = "EItemInPluginParent";

        metaPtr->addProperty(prop);
    }
    
    /**property ui_testVec3Parent*/
    {
        EItemMetaPropertyPtr prop = NewSmartPtr(EItemMetaProperty)();
        prop->name = "ui_testVec3Parent";
        prop->typeName = "EVec3";
        prop->value = itemSubPtr->ui_testVec3Parent;
        prop->m_owner = (intptr_t)itemSubPtr;
        prop->m_funSetProperty = EItemInPluginParent_OnSet_ui_testVec3Parent;
        prop->m_funGetProperty = EItemInPluginParent_OnGet_ui_testVec3Parent;
        prop->groupName = "EItemInPluginParent";

        metaPtr->addProperty(prop);
    }
    
    /**property ui_testVec4Parent*/
    {
        EItemMetaPropertyPtr prop = NewSmartPtr(EItemMetaProperty)();
        prop->name = "ui_testVec4Parent";
        prop->typeName = "EVec4";
        prop->value = itemSubPtr->ui_testVec4Parent;
        prop->m_owner = (intptr_t)itemSubPtr;
        prop->m_funSetProperty = EItemInPluginParent_OnSet_ui_testVec4Parent;
        prop->m_funGetProperty = EItemInPluginParent_OnGet_ui_testVec4Parent;
        prop->groupName = "EItemInPluginParent";

        metaPtr->addProperty(prop);
    }
    
    /**property ui_testMatrixParent*/
    {
        EItemMetaPropertyPtr prop = NewSmartPtr(EItemMetaProperty)();
        prop->name = "ui_testMatrixParent";
        prop->typeName = "EMatrix4x4";
        prop->value = itemSubPtr->ui_testMatrixParent;
        prop->m_owner = (intptr_t)itemSubPtr;
        prop->m_funSetProperty = EItemInPluginParent_OnSet_ui_testMatrixParent;
        prop->m_funGetProperty = EItemInPluginParent_OnGet_ui_testMatrixParent;
        prop->groupName = "EItemInPluginParent";

        metaPtr->addProperty(prop);
    }
    
    /**property ui_testStringParent*/
    {
        EItemMetaPropertyPtr prop = NewSmartPtr(EItemMetaProperty)();
        prop->name = "ui_testStringParent";
        prop->typeName = "EString";
        prop->value = itemSubPtr->ui_testStringParent;
        prop->m_owner = (intptr_t)itemSubPtr;
        prop->m_funSetProperty = EItemInPluginParent_OnSet_ui_testStringParent;
        prop->m_funGetProperty = EItemInPluginParent_OnGet_ui_testStringParent;
        prop->groupName = "EItemInPluginParent";

        metaPtr->addProperty(prop);
    }
    

    /**property ui_testDouble
    {
        tempValue = itemSubPtr->ui_testDouble;

        EItemMetaPropertyPtr prop = NewSmartPtr(EItemMetaProperty)();
        prop->name = "testDouble";
        prop->typeName = "Double";
        prop->value = tempValue;
        prop->maxValue = itemSubPtr->ui_testDouble_max;
        prop->minValue = itemSubPtr->ui_testDouble_min;
        prop->m_owner = (intptr_t)itemSubPtr;
        prop->m_funSetProperty = EItemTestAutogen_Fun_OnSet_testDouble;
        prop->m_funGetProperty = EItemTestAutogen_Fun_OnGet_testDouble;

        metaPtr->addProperty(prop);
    }*/

    return metaPtr;
}

/**Called by EItemInPluginParent's construct function*/
void EItemInPluginParent_construct_autogen(EItem* itemPtr)
{
    itemPtr->setFunCreateMeta(EItemInPluginParent_createMeta);
}
    

/**class factory functions*/
class EItemInPluginParent_factoryFun : public EItemMetaFunction
{
    virtual void callInternal(intptr_t itemPtr, ... )
    {
        va_list args;
        va_start(args, itemPtr);
        EVariant* valueReturn = va_arg(args, EVariant*);

        EItemInPluginParent* newPtr = new EItemInPluginParent();
        *valueReturn = (intptr_t)newPtr;

        va_end(args);
    }
};
    
void EItemInPluginParent_registToPlugin(const EItemPtr& rootType)
{
    EItemPtr type(new EItem);
    type->setName("EItemInPluginParent");
    type->setDescription("A parent class for reflection and plugin testing");

    EItemMetaFunctionPtr fun = NewSmartPtr(EItemInPluginParent_factoryFun)();

    fun->setName("EItemInPluginParent_Fun_factory");
    fun->setFunType(EItemMetaFunction::FunType::CONSTRUCTOR);

    type->getOrCreatMeta()->addFunction(fun);
    
    rootType->addChild(type);
}

// EItemMetaFunctionPtr EItemInPluginParentAutogen_getFactoryFun()
// {
    // EItemMetaFunctionPtr fun = NewSmartPtr(EItemTestAutogen_Fun_factory)();

    // fun->setName("EItemTestAutogen_Fun_factory");
    // fun->setFunType(EItemMetaFunction::FunType::CONSTRUCTOR);


    // return fun;
// }
    
